import request from '@/utils/request'

// 
// 商品列表页发起的axios请求
export const goodsList = (classifyId)=>{
    request.defaults.headers.common['token'] = 'eyJqdGkiOiJSSml6RUI3clBIIiwiaWF0IjoxNjA0MzEwNDY2LCJjaGFubmVsIjoiMSJ9.PclnHqy_GTMjNjDmDN6Z-Ce15ClDophN9ao4pv_e_Hs';
    let url = `/api/rest/h5Goods/findGoodsList?classifyIds=${classifyId}&currentpage=1&sortType=4&sortDirection=desc&goodsSelect=&goodsLowPrice=&goodsHighPrice=&userBrand=&size=&pageSize=`
    return request.get(url)
}

// 购物车

export const goodsCartPop = (goodsCode)=>{
    request.defaults.headers.common['token'] = 'eyJqdGkiOiJSSml6RUI3clBIIiwiaWF0IjoxNjA0MzEwNDY2LCJjaGFubmVsIjoiMSJ9.PclnHqy_GTMjNjDmDN6Z-Ce15ClDophN9ao4pv_e_Hs';
    let url2 =`/api/rest/h5Goods/goodsDetail?goodsCode=${goodsCode}`
    return request.get(url2)
}


// 商品分类数据

export const List = ()=>{
    let url3 = `/api/classify/h5/SELECTED/h5_list.json`
    return request.get(url3)
}